package com.chat.websocket;

import com.chat.websocket.config.MinIOConfig;
import com.chat.websocket.util.websocket.WebSocket;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@MapperScan(value = "com.chat.websocket.mapper")
@EnableConfigurationProperties({
        MinIOConfig.class
})
public class WebsocketApplication {

    public static void main(String[] args) {
//        SpringApplication.run(WebsocketDemoApplication.class, args);
        SpringApplication springApplication = new SpringApplication(WebsocketApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        //解决WebSocket不能注入的问题
        WebSocket.setApplicationContext(configurableApplicationContext);
    }

}